package com.ganbo.user.client.controller;

import com.ganbo.user.api.model.User;
import com.ganbo.user.client.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/userConsume")
public class UserClientController {


    @Autowired
    UserService userService;

    @GetMapping("/get")
    public User getUser(Long id, String username) {
        return userService.getUser(id, username);
    }

    @PostMapping("/add")
    public User add(User user) {
        return userService.add(user);
    }
}
